home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 September / maximum-cd-2000-09.iso / Vampire the Masquerade / vampire_demo.exe / Codex.nob / RegionTriggerSound.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-22  |  1.6 KB  |  46 lines

  1. public class RegionTriggerSound extends Codex {
  2.    private String _soundName;
  3.    private float _minDist;
  4.    private float _maxDist;
  5.    private int _volume;
  6.    private int _pan;
  7.    private int _flags;
  8.    private int _playOnce;
  9.    private boolean done;
  10.    public static String[] _params = new String[]{"Sound name", "Min Distance;300", "MaxDistance;600", "Volume;50", "Pan;0", "Flags;0", "Play once; 1"};
  11.  
  12.    public void restore(int flags) {
  13.       if (this._playOnce == 1) {
  14.          this.done = CodexSequence.RestoreBoolean();
  15.       }
  16.  
  17.    }
  18.  
  19.    public void entered(int guid, int causeGUID, int captureID) {
  20.       if (Codex.IsPlayerGuid(causeGUID)) {
  21.          if (!this.done) {
  22.             new CodexSound(this._soundName, this._minDist, this._maxDist, this._volume, this._pan, this._flags, ((Codex)this).GetClassThing());
  23.             this.done = true;
  24.          }
  25.  
  26.       }
  27.    }
  28.  
  29.    public void save(int flags) {
  30.       if (this._playOnce == 1) {
  31.          CodexSequence.SaveBoolean(this.done);
  32.       }
  33.  
  34.    }
  35.  
  36.    public RegionTriggerSound(String soundName, float minDist, float maxDist, int volume, int pan, int flags, int playOnce) {
  37.       this._soundName = soundName;
  38.       this._minDist = minDist;
  39.       this._maxDist = maxDist;
  40.       this._volume = volume;
  41.       this._pan = pan;
  42.       this._flags = flags;
  43.       this._playOnce = playOnce;
  44.    }
  45. }
  46.